package S14.second;
public class Person {
	private String name; //姓名
	private int score; //成绩
	public Person(String name,int age) {
		this.name=name;
		this.score=age;
	}
	public int getScore() {
		return score;
	}
	@Override
	public String toString() {
		return name+"•"+score;
	}
	@Override
	public boolean equals(Object obj) { //重写Object的equals方法
		Person p=(Person)obj;
		return name.equals(p.name) && score==p.getScore();
	}
	@Override
	public int hashCode() { //重写Object的hashCode方法
		return (name+score).hashCode();
	}
}